package com.yishe.biz.ys;

import com.yishe.biz.mysql.YsCaseInfoBiz;
import com.yishe.entites.mysql.CaseTypeMaintain;
import com.yishe.entites.mysql.YsCaseInfo;
import com.yishe.mapper.mysql.CaseTypeMaintainMapper;
import com.yishe.mapper.mysql.YsCaseInfoMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author : chusifeng
 * @version :
 * @date :Create in 2021/4/26 11:10
 * @description:
 * @package com.yishe.biz.ys
 * @className YsBiz
 */
@Slf4j
@Service
public class YsBiz {
    @Resource
    private YsCaseInfoMapper ysCaseInfoMapper;
    @Resource
    private CaseTypeMaintainMapper caseTypeMaintainMapper;
    /**
     * 根据课程编号获取课程详细信息
     */
    public YsCaseInfo getCaseInfoByCaseNo(String caseNo) {
        YsCaseInfo ysCaseInfo = new YsCaseInfo();
        ysCaseInfo.setCaseNo(caseNo);
        return ysCaseInfoMapper.selectOne(ysCaseInfo);
    }
    /**
     * 根据课程类型获取课程详细信息
     */
    public CaseTypeMaintain getCaseTypeByCaseType(String caseType) {
        CaseTypeMaintain typeMaintain = new CaseTypeMaintain();
        typeMaintain.setCaseType(caseType);
        return caseTypeMaintainMapper.selectOne(typeMaintain);
    }

}
